home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / Mail / RCS / v7.local.c,v < prev    next >
Encoding:
Text File  |  1990-02-09  |  1.9 KB  |  106 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     90.02.08.17.51.22;  author jhh;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     90.02.08.15.45.37;  author jhh;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @Ported to sprite (patched in changes from old version of mail
  27. @
  28. text
  29. @/*
  30.  * Copyright (c) 1980 Regents of the University of California.
  31.  * All rights reserved.
  32.  *
  33.  * Redistribution and use in source and binary forms are permitted
  34.  * provided that the above copyright notice and this paragraph are
  35.  * duplicated in all such forms and that any documentation,
  36.  * advertising materials, and other materials related to such
  37.  * distribution and use acknowledge that the software was developed
  38.  * by the University of California, Berkeley.  The name of the
  39.  * University may not be used to endorse or promote products derived
  40.  * from this software without specific prior written permission.
  41.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  42.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  43.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  44.  */
  45.  
  46. #ifndef lint
  47. static char sccsid[] = "@@(#)v7.local.c    5.7 (Berkeley) 7/7/88";
  48. #endif /* not lint */
  49.  
  50. /*
  51.  * Mail -- a mail program
  52.  *
  53.  * Version 7
  54.  *
  55.  * Local routines that are installation dependent.
  56.  */
  57.  
  58. #include "rcv.h"
  59.  
  60. /*
  61.  * Locate the user's mailbox file (ie, the place where new, unread
  62.  * mail is queued).
  63.  */
  64. findmail(user, buf)
  65.     char *user;
  66.     char *buf;
  67. {
  68.  
  69.     strcpy(copy("/sprite/spool/mail/", buf), user);
  70. }
  71.  
  72. /*
  73.  * Get rid of the queued mail.
  74.  */
  75. demail()
  76. {
  77.  
  78.     if (value("keep") != NOSTR || remove(mailname) < 0)
  79.         close(creat(mailname, 0600));
  80. }
  81.  
  82. /*
  83.  * Discover user login name.
  84.  */
  85. char*
  86. username()
  87. {
  88.     char *np;
  89.  
  90.     if ((np = getenv("USER")) != NOSTR)
  91.         return np;
  92.     return getname(getuid());
  93. }
  94. @
  95.  
  96.  
  97. 1.1
  98. log
  99. @Initial revision
  100. @
  101. text
  102. @d41 1
  103. a41 1
  104.     strcpy(copy("/usr/spool/mail/", buf), user);
  105. @
  106.